<?php 

$this->headScript()
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.core.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.widget.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.button.js");
$this->headLink()->appendStylesheet($this->baseUrl(). '/js/jquery/development-bundle/themes/ui-lightness/jquery.ui.all.css');
$this->headScript()

?>
<p class="errorText">&nbsp;<?php echo $this->messageError; ?></p>
<div class="section">
<div class="section_inner">
<div class="title_wrapper">
	<h2>Configuración Paypal</h2>

</div>
<div class="section_content">

			<form action="<?php echo $this->baseUrl();?>/admin/paypal/config/"  method="post" id="addform"  class="search_form general_form">
<!--[if !IE]>start fieldset<![endif]-->
								<fieldset>
									<!--[if !IE]>start forms<![endif]-->
			<div class="forms">			
			<input type="hidden" name="id" value="<?php echo (int) $this->PaypalInfo['Id']; ?>" />			
			  
			<!--[if !IE]>start row<![endif]-->
			<div class="row">
				<label>Usuario:</label>
				<div class="inputs">
					<span class="input_wrapper">
					<input class="text" type="text" name="User" id="User" size = "53" maxlength = "100" value="<?php echo $this->PaypalInfo['User'];?>" />
					</span>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			 
			<!--[if !IE]>start row<![endif]-->
			<div class="row">
				<label>Contraseña:</label>
				<div class="inputs">
					<span class="input_wrapper">
					<input class="text" type="text" name="Pwd" id="Pwd" size = "53" maxlength = "100" value="<?php echo $this->PaypalInfo['Pwd'];?>" />
					
					</span>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			<div class="row">
				<label>Firma:</label>
				<div class="inputs">
					<span class="input_wrapper">
					<input class="text" type="text" name="Signature" id="Signature" size = "53" maxlength = "100" value="<?php echo $this->PaypalInfo['Signature'];?>" />
					</span>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
						<!--[if !IE]>end row<![endif]-->
			<div class="row">
				<label>Paypal Login:</label>
				<div class="inputs">
						<select name="PaypalLogin" id="PaypalLogin">
							<option value="live" <?php echo ($this->PaypalInfo['PaypalLogin'] == "live")? 'selected="selected"' : '' ;?>>live</option>
							<option value="sandbox" <?php echo ($this->PaypalInfo['PaypalLogin'] == "sandbox")? 'selected="selected"' : '' ;?>>sandbox</option>
						</select>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			<!--[if !IE]>end row<![endif]-->
			<div class="row">
				<label>Moneda Usada:</label>
				<div class="inputs">
					<select name="CurrencyCode" id="CurrencyCode">
							<option value="USD" <?php echo ($this->PaypalInfo['CurrencyCode'] == "USD")? 'selected="selected"' : '' ;?>>USD</option>
							<option value="MXN" <?php echo ($this->PaypalInfo['CurrencyCode'] == "MXN")? 'selected="selected"' : '' ;?>>MXN</option>
						</select>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			<!--[if !IE]>end row<![endif]-->
			<div class="row">
				<label>Email de la cuenta Paypal:</label>
				<div class="inputs">
					<span class="input_wrapper">
						<input class="text" type="text" name="EmailPaypal" id="EmailPaypal" size = "53" maxlength = "100" value="<?php echo $this->PaypalInfo['EmailPaypal'];?>" />
					</span>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			<!--[if !IE]>end row<![endif]-->
			<div class="row">
				<label>Success Return:</label>
				<div class="inputs">
					<span class="input_wrapper">
						<input class="text" type="text" name="SuccessReturn" id="SuccessReturn" size = "53" maxlength = "100" value="<?php echo $this->PaypalInfo['SuccessReturn'];?>" />
					</span>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			
			<!--[if !IE]>end row<![endif]-->
			<div class="row">
				<label>Cancel Return:</label>
				<div class="inputs">
					<span class="input_wrapper">
						<input class="text" type="text" name="CancelReturn" id="CancelReturn" size = "53" maxlength = "100" value="<?php echo $this->PaypalInfo['CancelReturn'];?>" />
					</span>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			
						<!--[if !IE]>end row<![endif]-->
			<div class="row">
				<label>Url IPN:</label>
				<div class="inputs">
					<span class="input_wrapper">
						<input class="text" type="text" name="NotifyIPNUrl" id="NotifyIPNUrl" size = "53" maxlength = "100" value="<?php echo $this->PaypalInfo['NotifyIPNUrl'];?>" />
					</span>
					<span class="system positive"></span>
				</div>
			</div>
			<!--[if !IE]>end row<![endif]-->
			
			
			

						<a href="<?php echo $this->baseUrl();?>/admin/taxes/" id="canceladd">Cancelar</a>
						<a href="#" id="testconfig">Probar configuración</a>
						<input type="submit" id="addtaxe" name="agregar"  value="guardar" />
			    	
			    	</div>
			    </fieldset>
			    
			    	
			</form>
</div>
</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$( "#canceladd, #addtaxe, #testconfig" ).button();
	
	$("a#testconfig").click(function(){

		var User=$("input#User").val();
		var Pwd=$("input#Pwd").val();
		var Signature=$("input#Signature").val();
		var data_post="User="+User+"&Pwd="+Pwd+"&Signature="+Signature;
		
		jQuery.ajax({
            type: "POST",
            beforeSend: function(){},
            url: site+"admin/paypal/testconfig/",
            data: data_post,
            success: function(stat){
	            
            }
        });

		return false;
	});
	
});
</script>

